package com.yueyang.sojourn.server.service.sojourn.merch;

import com.yueyang.sojourn.server.model.po.SojournMerch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author any.yang
 * @summary
 * @Copyright (c) 2020, Yueyang Group All Rights Reserved.
 * @since 2020-02-17
 */
@Mapper
interface SojournMerchMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SojournMerch record);

    int insertSelective(SojournMerch record);

    SojournMerch selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SojournMerch record);

    int updateByPrimaryKey(SojournMerch record);

    List<SojournMerch> findBy(@Param("keyWord") String keyWord, @Param("projectId") Long projectId, @Param("shelfStatusList") List<Integer> shelfStatusList);

    List<SojournMerch> selectByShelfStatus(@Param("shelfStatus") int shelfStatus);

    void updateShelfStatusByIds(@Param("shelfStatus") int shelfStatus, @Param("merchIds") List<Long> merchIds);

    /**
     * 收藏列表
     *
     * @param userId
     * @return
     */
    List<SojournMerch> selectCollectList(@Param("userId") long userId);

    List<SojournMerch> findByLayoutId(@Param("layoutId") int layoutId, @Param("shelfStatus") Integer shelfStatus);

    List<SojournMerch> findByIds(List<Long> ids);

}
